package com.yyds.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yyds.common.MyJSON;
import com.yyds.mapper.PersonResidentVoMapper;
import com.yyds.mapper.VaccineVaccinatorVoMapper;
import com.yyds.mapper.VaccineVaccineMapper;
import com.yyds.pojo.VaccineVaccinator;
import com.yyds.service.VaccineVaccinatorVoService;
import com.yyds.vo.VaccineVaccinatorVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("vaccineVaccinatorsVoService")
public class

VaccineVaccinatorVoServiceImpl implements VaccineVaccinatorVoService {

    @Autowired
    @Qualifier("vaccineVaccinatorVoMapper")
    private VaccineVaccinatorVoMapper vaccineVaccinatorVoMapper;

    @Override
    public MyJSON<VaccineVaccinatorVo> queryAllVaccineVaccinatorService(Map<String, Object> map) {
        Integer page = Integer.parseInt(map.get("page") + "");
        Integer limit = Integer.parseInt(map.get("limit") + "");
        PageHelper.startPage(page, limit);
        List<VaccineVaccinatorVo> vaccinatorsVos = vaccineVaccinatorVoMapper.queryAllVaccineVaccinatorMapper(map);
        PageInfo<VaccineVaccinatorVo> pageInfo = new PageInfo<>(vaccinatorsVos);
        MyJSON<VaccineVaccinatorVo> myJSON = new MyJSON<>();
        myJSON.setMsg("查询全部人员信息");
        myJSON.setCode(0);
        myJSON.setData(pageInfo.getList());
        myJSON.setCount(pageInfo.getTotal());
        return myJSON;
    }
}
